3.174 \(\int \frac{\tanh (c+d x)}{a+b \tanh ^2(c+d x)} \, dx\)

Optimal. Leaf size=42 \[ \frac{\log \left (a+b \tanh ^2(c+d x)\right )}{2 d (a+b)}+\frac{\log (\cosh (c+d x))}{d (a+b)} \]

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) + Log[a + b*Tanh[c + d*x]^2]/(2*(a + b)*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0612942, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.19, Rules used = {3670, 444, 36, 31} \[ \frac{\log \left (a+b \tanh ^2(c+d x)\right )}{2 d (a+b)}+\frac{\log (\cosh (c+d x))}{d (a+b)} \]

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]/(a + b*Tanh[c + d*x]^2),x]

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) + Log[a + b*Tanh[c + d*x]^2]/(2*(a + b)*d)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{\tanh (c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{(1-x) (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{1}{1-x} \, dx,x,\tanh ^2(c+d x)\right )}{2 (a+b) d}+\frac{b \operatorname{Subst}\left (\int \frac{1}{a+b x} \, dx,x,\tanh ^2(c+d x)\right )}{2 (a+b) d}\\ &=\frac{\log (\cosh (c+d x))}{(a+b) d}+\frac{\log \left (a+b \tanh ^2(c+d x)\right )}{2 (a+b) d}\\ \end{align*}

Mathematica [A]  time = 0.0237822, size = 35, normalized size = 0.83 \[ \frac{\log \left (a+b \tanh ^2(c+d x)\right )+2 \log (\cosh (c+d x))}{2 a d+2 b d} \]

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]/(a + b*Tanh[c + d*x]^2),x]

[Out]

(2*Log[Cosh[c + d*x]] + Log[a + b*Tanh[c + d*x]^2])/(2*a*d + 2*b*d)

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 71, normalized size = 1.7 \begin{align*} -{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) }{d \left ( 2\,b+2\,a \right ) }}+{\frac{\ln \left ( a+b \left ( \tanh \left ( dx+c \right ) \right ) ^{2} \right ) }{d \left ( 2\,b+2\,a \right ) }}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) }{d \left ( 2\,b+2\,a \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)/(a+b*tanh(d*x+c)^2),x)

[Out]

-1/d/(2*b+2*a)*ln(tanh(d*x+c)+1)+1/2*ln(a+b*tanh(d*x+c)^2)/(a+b)/d-1/d/(2*b+2*a)*ln(tanh(d*x+c)-1)

________________________________________________________________________________________

Maxima [A]  time = 1.08011, size = 78, normalized size = 1.86 \begin{align*} \frac{d x + c}{{\left (a + b\right )} d} + \frac{\log \left (2 \,{\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} +{\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \,{\left (a + b\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

(d*x + c)/((a + b)*d) + 1/2*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/((a + b)*d)

________________________________________________________________________________________

Fricas [B]  time = 1.75035, size = 220, normalized size = 5.24 \begin{align*} -\frac{2 \, d x - \log \left (\frac{2 \,{\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} +{\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right )}{2 \,{\left (a + b\right )} d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(2*d*x - log(2*((a + b)*cosh(d*x + c)^2 + (a + b)*sinh(d*x + c)^2 + a - b)/(cosh(d*x + c)^2 - 2*cosh(d*x
+ c)*sinh(d*x + c) + sinh(d*x + c)^2)))/((a + b)*d)

________________________________________________________________________________________

Sympy [A]  time = 11.3964, size = 156, normalized size = 3.71 \begin{align*} \begin{cases} \frac{\tilde{\infty } x}{\tanh{\left (c \right )}} & \text{for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac{x - \frac{\log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{d}}{a} & \text{for}\: b = 0 \\\frac{1}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text{for}\: a = - b \\\frac{x \tanh{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text{for}\: d = 0 \\\frac{2 d x}{2 a d + 2 b d} + \frac{\log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tanh{\left (c + d x \right )} \right )}}{2 a d + 2 b d} + \frac{\log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tanh{\left (c + d x \right )} \right )}}{2 a d + 2 b d} - \frac{2 \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{2 a d + 2 b d} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)/(a+b*tanh(d*x+c)**2),x)

[Out]

Piecewise((zoo*x/tanh(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((x - log(tanh(c + d*x) + 1)/d)/a, Eq(b, 0)), (1/(2
*b*d*tanh(c + d*x)**2 - 2*b*d), Eq(a, -b)), (x*tanh(c)/(a + b*tanh(c)**2), Eq(d, 0)), (2*d*x/(2*a*d + 2*b*d) +
 log(-I*sqrt(a)*sqrt(1/b) + tanh(c + d*x))/(2*a*d + 2*b*d) + log(I*sqrt(a)*sqrt(1/b) + tanh(c + d*x))/(2*a*d +
 2*b*d) - 2*log(tanh(c + d*x) + 1)/(2*a*d + 2*b*d), True))

________________________________________________________________________________________

Giac [A]  time = 1.18993, size = 84, normalized size = 2. \begin{align*} \frac{\log \left ({\left | a{\left (e^{\left (2 \, d x + 2 \, c\right )} + e^{\left (-2 \, d x - 2 \, c\right )}\right )} + b{\left (e^{\left (2 \, d x + 2 \, c\right )} + e^{\left (-2 \, d x - 2 \, c\right )}\right )} + 2 \, a - 2 \, b \right |}\right )}{2 \,{\left (a d + b d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*log(abs(a*(e^(2*d*x + 2*c) + e^(-2*d*x - 2*c)) + b*(e^(2*d*x + 2*c) + e^(-2*d*x - 2*c)) + 2*a - 2*b))/(a*d
 + b*d)